const {
	printError
} = require("./printUtil")

function saveStorage(key, value) {
	try {
		uni.setStorageSync(key, value)
	} catch (error) {
		printError("save storage 错误", error.errMsg, key, value);
	}
}

function readStorage(key) {
	try {
		return uni.getStorageSync(key);
	} catch (error) {
		printError("read storage 错误", error.errMsg, key);
	}
}

function removeStorage(key) {
	try {
		return uni.removeStorageSync(key);
	} catch (error) {
		printError("remove storage 错误", error.errMsg, key);
	}
}

module.exports = {
	saveStorage,
	readStorage,
	removeStorage
}
